﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using KPIS.GERP.Models.Class;

namespace KPIS.GERP.Models.ICM
{
    [DataContract, Table("IcmDispose")]
    public class Dispose
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [DataMember, Display(Name = "DisposeId", ResourceType = typeof(Resources.DisposeResource))]
        public int DisposeId { get; set; }

        [CustomRequired]
        [DataMember, Display(Name = "DisposeDesc", ResourceType = typeof(Resources.DisposeResource))]
        public string DisposeDesc { get; set; }

        [CustomRequired]
        [DataMember, Display(Name = "DisposeDate", ResourceType = typeof(Resources.DisposeResource))]
        public Nullable<System.DateTime> DisposeDate { get; set; }

        [DataMember, Display(Name = "AssetCode", ResourceType = typeof(Resources.DisposeResource))]
        public string AssetCode { get; set; }

        [ForeignKey("Warehouse")]
        [DataMember, Display(Name = "FromIcmWhId", ResourceType = typeof(Resources.DisposeResource))]
        public int? FromIcmWhId { get; set; }

        [ForeignKey("Jobsite")]
        [DataMember, Display(Name = "FromJobsiteId", ResourceType = typeof(Resources.DisposeResource))]
        public int? FromJobsiteId { get; set; }

        [DataMember, Display(Name = "FromOtherPlace", ResourceType = typeof(Resources.DisposeResource))]
        public string FromOtherPlace { get; set; }

        [DataMember, Display(Name = "ToOtherSite", ResourceType = typeof(Resources.DisposeResource))]
        public string ToOtherSite { get; set; }

        [DataMember, Display(Name = "ToOtherPlace", ResourceType = typeof(Resources.DisposeResource))]
        public string ToOtherPlace { get; set; }

        [ForeignKey("DisposeType")]
        [DataMember, Display(Name = "DisposeTypeId", ResourceType = typeof(Resources.DisposeResource))]
        public int? DisposeTypeId { get; set; }

        [ForeignKey("MasResourceType")]
        [DataMember, Display(Name = "ResTypeId", ResourceType = typeof(Resources.DisposeResource))]
        public int ResTypeId { get; set; }

        [DataMember, Display(Name = "Remark", ResourceType = typeof(Resources.DisposeResource))]
        public string Remark { get; set; }

        [ForeignKey("Employee")]
        [DataMember, Display(Name = "ApprovedBy", ResourceType = typeof(Resources.DisposeResource))]
        public int? ApprovedBy { get; set; }

        [DataMember, Display(Name = "ApprovedWhen", ResourceType = typeof(Resources.DisposeResource))]
        public Nullable<System.DateTime> ApprovedWhen { get; set; }

        [DataMember, Display(Name = "DisposeStatus", ResourceType = typeof(Resources.DisposeResource))]
        public string DisposeStatus { get; set; }

        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(Resources.DisposeResource))]
        public string RecordStatus { get; set; }

        [DataMember, Display(Name = "CreatedBy", ResourceType = typeof(Resources.DisposeResource))]
        public int? CreatedBy { get; set; }

        [DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(Resources.DisposeResource))]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

        [DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(Resources.DisposeResource))]
        public int? UpdatedBy { get; set; }

        [DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(Resources.DisposeResource))]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

        [ForeignKey("CommitteeGroup")]
        [DataMember]
        public virtual int? CommitteeGroupId { get; set; }

        [DataMember]
        public virtual CommitteeGroup CommitteeGroup { get; set; }

        [DataMember]
        public virtual MasResourceType MasResourceType { get; set; }

        [DataMember]
        public virtual Warehouse Warehouse { get; set; }

        [DataMember]
        public virtual HRM.JobSite Jobsite { get; set; }

        [DataMember]
        public virtual IcmMasLookUp DisposeType { get; set; }

        [DataMember]
        public virtual HRM.Employee Employee { get; set; }

    }
}
